package com.guochenglang.www.dao;

import com.guochenglang.www.pojo.CollectUser;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface CollectUserDao {
    /**
     * 搜索关注用户
     *
     * @param collectUser 搜索条件
     * @return 搜索列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<CollectUser> collectUserSelect(CollectUser collectUser) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 分页搜索关注用户
     *
     * @param page       当前页码
     * @param num        每页显示个数
     * @param conditions 搜索条件
     * @param order      排序条件
     * @param mode       升序还是降序
     * @return 关注列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<CollectUser> collectUserSelectByLimit(int page, int num, CollectUser conditions, String order, String mode) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 条件关注用户
     *
     * @param collectUser 收藏列表信息
     * @return 收藏的主键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    int insertCollectUser(CollectUser collectUser) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 取消收藏
     *
     * @param collectUser 取消的条件
     * @return 取消的行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    int deleteCollectUser(CollectUser collectUser) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;
}
